import ZDnd from "@/plugins/dnd/dnd";

// 拖拽演示
function Dnd() {
  const [containerRef, boxRef] = [useRef(null), useRef(null)];
  useEffect(() => {
    let dnd = new ZDnd(containerRef.current, boxRef.current);
    console.log(dnd)
  }, []);

  return (
    <div
      style={{
        width: "500px",
        height: "500px",
        margin: "200px",
        overflow: "scroll",
      }}
    >
      <div
        className="container"
        ref={containerRef}
        style={{
          width: "1000px",
          height: "2000px",
          background: "pink",
        }}
      >
        <div
          ref={boxRef}
          className="dnd-box"
          style={{
            width: "100px",
            height: "100px",
            background: "red",
          }}
        ></div>
      </div>
    </div>
  );
}
export default Dnd;
